import { legacy_createStore as createStore, applyMiddleware, compose } from "redux";
import thunk from 'redux-thunk';
import reducer from './reducer'

// 为了可以开控制台看redux插件
const composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose;

// 第一个参数是reducer、第二个参数可以添加中间件来加强
const store = createStore(reducer, composeEnhancers(applyMiddleware(thunk)))

export default store;